

from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtGui import *
import os

class Ui_MainWindow(object):
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("Form")
        MainWindow.resize(510, 400)
        MainWindow.setFixedSize(MainWindow.width(), MainWindow.height())

        self.KeywordEdit = QtWidgets.QLineEdit(MainWindow)
        self.KeywordEdit.setGeometry(QtCore.QRect(95, 20, 315, 20))
        self.KeywordEdit.setInputMask("")
        self.KeywordEdit.setText("")
        self.KeywordEdit.setObjectName("KeywordEdit")

        self.NumEdit = QtWidgets.QLineEdit(MainWindow)
        self.NumEdit.setGeometry(QtCore.QRect(350, 50, 60, 20))
        self.NumEdit.setInputMask("")
        self.NumEdit.setText("")
        self.NumEdit.setObjectName("NumEdit")

        self.YearEdit = QtWidgets.QLineEdit(MainWindow)
        self.YearEdit.setGeometry(QtCore.QRect(95, 50, 50, 20))
        self.YearEdit.setInputMask("")
        self.YearEdit.setText("")
        self.YearEdit.setObjectName("YearEdit")

        self.YearEdit2 = QtWidgets.QLineEdit(MainWindow)
        self.YearEdit2.setGeometry(QtCore.QRect(165, 50, 50, 20))
        self.YearEdit2.setInputMask("")
        self.YearEdit2.setText("")
        self.YearEdit2.setObjectName("YearEdit")

        self.PathEdit = QtWidgets.QLineEdit(MainWindow)
        self.PathEdit.setGeometry(QtCore.QRect(95, 110, 290, 20))
        self.PathEdit.setInputMask("")
        self.PathEdit.setText("")
        self.PathEdit.setPlaceholderText("")
        self.PathEdit.setObjectName("PathEdit")

        self.ShowInfoEdit = QtWidgets.QPlainTextEdit(MainWindow)
        self.ShowInfoEdit.setGeometry(QtCore.QRect(20, 170, 470, 180))
        self.ShowInfoEdit.setReadOnly(False)
        self.ShowInfoEdit.setObjectName("ShowInfoEdit")

        self.progressBar = QtWidgets.QProgressBar(MainWindow)
        self.progressBar.setGeometry(QtCore.QRect(70, 365, 420, 23))
        self.progressBar.setProperty("value", 0)
        self.progressBar.setObjectName("progressBar")

        self.comboBox = QtWidgets.QComboBox(MainWindow)
        self.comboBox.setGeometry(QtCore.QRect(95, 80, 120, 20))
        self.comboBox.setObjectName("comboBox")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.addItem("")
        self.comboBox.addItem("")

        self.spinBox = QtWidgets.QSpinBox(MainWindow)
        self.spinBox.setGeometry(QtCore.QRect(95, 140, 60, 20))
        self.spinBox.setMinimum(1)
        self.spinBox.setMaximum(5)
        self.spinBox.setProperty("value", 1)
        self.spinBox.setObjectName("spinBox")

        self.radioButton1 = QtWidgets.QRadioButton(MainWindow)
        self.radioButton1.setGeometry(QtCore.QRect(170,140,60,20))
        self.radioButton1.setChecked(True)
        self.radioButton1.setObjectName("radioButton1")

        self.radioButton2 = QtWidgets.QRadioButton(MainWindow)
        self.radioButton2.setGeometry(QtCore.QRect(230, 140, 60, 20))
        self.radioButton2.setObjectName("radioButton2")

        self.radioButton3 = QtWidgets.QRadioButton(MainWindow)
        self.radioButton3.setGeometry(QtCore.QRect(290, 140, 80, 20))
        self.radioButton3.setObjectName("radioButton3")

        self.SearchButton = QtWidgets.QPushButton(MainWindow)
        self.SearchButton.setGeometry(QtCore.QRect(420, 20, 70, 80))
        self.SearchButton.setObjectName("SearchButton")

        self.ExitButton = QtWidgets.QPushButton(MainWindow)
        self.ExitButton.setGeometry(QtCore.QRect(420, 110, 70, 50))
        self.ExitButton.setObjectName("ExitButton")
        self.ExitButton.setText("ExitButton")

        self.PathSelectButton = QtWidgets.QToolButton(MainWindow)
        self.PathSelectButton.setGeometry(QtCore.QRect(385, 109, 25, 22))
        self.PathSelectButton.setObjectName("PathSelectButton")

        self.OpenPathButton = QtWidgets.QToolButton(MainWindow)
        self.OpenPathButton.setGeometry(QtCore.QRect(350, 79, 60, 22))
        self.OpenPathButton.setObjectName("OpenPathButton")

        self.HelpButton = QtWidgets.QToolButton(MainWindow)
        self.HelpButton.setGeometry(QtCore.QRect(275, 79, 60, 22))
        self.HelpButton.setObjectName("HelpButton")

        font = QtGui.QFont()
        font.setFamily("宋体")
        font.setPointSize(11)
        self.label = QtWidgets.QLabel(MainWindow)
        self.label.setGeometry(QtCore.QRect(20, 80, 70, 21))
        self.label.setFont(font)
        self.label.setObjectName("label")

        self.label_2 = QtWidgets.QLabel(MainWindow)
        self.label_2.setGeometry(QtCore.QRect(20, 50, 71, 21))
        self.label_2.setFont(font)
        self.label_2.setObjectName("label_2")

        self.label_3 = QtWidgets.QLabel(MainWindow)
        self.label_3.setGeometry(QtCore.QRect(20, 20, 71, 21))
        self.label_3.setFont(font)
        self.label_3.setObjectName("label_3")

        self.label_4 = QtWidgets.QLabel(MainWindow)
        self.label_4.setGeometry(QtCore.QRect(275, 50, 70, 21))
        self.label_4.setFont(font)
        self.label_4.setObjectName("label_4")
        self.label_4.setText('篇数:')

        self.label_5 = QtWidgets.QLabel(MainWindow)
        self.label_5.setGeometry(QtCore.QRect(20, 110, 71, 21))
        self.label_5.setFont(font)
        self.label_5.setObjectName("label_5")

        self.label_6 = QtWidgets.QLabel(MainWindow)
        self.label_6.setGeometry(QtCore.QRect(20, 365, 71, 21))
        self.label_6.setFont(font)
        self.label_6.setObjectName("label_6")

        self.label_7 = QtWidgets.QLabel(MainWindow)
        self.label_7.setGeometry(QtCore.QRect(151, 50, 10, 21))
        self.label_7.setFont(font)
        self.label_7.setObjectName("label_7")

        self.label_8 = QtWidgets.QLabel(MainWindow)
        self.label_8.setGeometry(QtCore.QRect(20, 140, 70, 21))
        self.label_8.setFont(font)
        self.label_8.setObjectName("label_8")

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)


    def retranslateUi(self, MainWindow):
        _translate = QtCore.QCoreApplication.translate
        MainWindow.setWindowTitle(_translate("MainWindow", "PaperAssistant--by:Red"))
        self.KeywordEdit.setPlaceholderText(_translate("MainWindow", "请输入关键词！"))
        self.NumEdit.setPlaceholderText(_translate("MainWindow", "例：10"))
        self.YearEdit.setPlaceholderText(_translate("MainWindow", "例:2017"))
        self.YearEdit2.setPlaceholderText(_translate("MainWindow", "例:2020"))

        self.comboBox.setItemText(0, _translate("MainWindow", "Pubmed"))
        self.comboBox.setItemText(1, _translate("MainWindow", "ScienceDirect"))
        self.comboBox.setItemText(2, _translate("MainWindow", "IEEE"))
        self.comboBox.setItemText(3, _translate("MainWindow", "Springer"))

        self.radioButton1.setText(_translate("MainWindow", "仅搜索"))
        self.radioButton2.setText(_translate("MainWindow", "仅下载"))
        self.radioButton3.setText(_translate("MainWindow", "搜索并下载"))

        self.label.setText(_translate("MainWindow", "数 据 库："))
        self.label_2.setText(_translate("MainWindow", "年    份："))
        self.label_3.setText(_translate("MainWindow", "关 键 词："))
        self.label_4.setText(_translate("MainWindow", "搜索篇数："))
        self.label_5.setText(_translate("MainWindow", "保存地址："))
        self.label_6.setText(_translate("MainWindow", "进度："))
        self.label_7.setText(_translate("MainWindow", "-"))
        self.label_8.setText(_translate("MainWindow", "下载线程："))

        self.SearchButton.setText(_translate("MainWindow", "开始"))
        self.ExitButton.setText(_translate("MainWindow", "关闭软件"))
        self.PathSelectButton.setText(_translate("MainWindow", "..."))
        self.OpenPathButton.setText(_translate("MainWindow", "打开目录"))
        self.HelpButton.setText(_translate("MainWindow", "使用帮助"))
